package in.srain.cube.views.ptr.loadmore;

import android.content.Context;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;
import android.widget.ListAdapter;

/**
 * Created by handsome-Bob on 2017/6/9.
 * <p>
 * 一个足够高并且可以做加载更多的GridView
 */
public class GridViewBeLoadMoreAndRefresh extends GridViewWithHeaderAndFooter {

    /**
     * 将空视图所固定在一屏内
     */
//    private boolean mFitHeightInScreen = true;
//    private boolean mSizeable;
//
//    public void setFitHeightInScreen(boolean fitHeightInScreen) {
//        this.mFitHeightInScreen = fitHeightInScreen;
//    }
//
//    public void getFitHeight(boolean fitHeight) {
//        this.mFitHeightInScreen = fitHeight;
//    }


    public GridViewBeLoadMoreAndRefresh(Context context) {
        super(context);
    }

    public GridViewBeLoadMoreAndRefresh(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public GridViewBeLoadMoreAndRefresh(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }


//    /**
//     * 让GridView变得足够高
//     * <p>
//     * 这个方法存在的意义是为了让页面足够高，但是，需要一个父类的滑动布局作为支撑，目前这个项目不需要这个方法，注释掉他
//     */
//    public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
//        int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2,
//                MeasureSpec.AT_MOST);
//        super.onMeasure(widthMeasureSpec, expandSpec);
//    }

//    @Override
//    public void setAdapter(ListAdapter adapter) {
//        if (getLayoutManager() == null) {
//            setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
//        }
//        super.setAdapter(adapter);
//    }
}


